package com.wlyuan.open.scanner.utils.enums.order;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @Description 附件类型
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum TransportAttachTypeEnum implements NamedValue<Integer> {

    /**
     * 签收照片
     */
    SIGN(1, 5, "签收照片"),
    /**
     * 扫码签收照片
     */
    SCANNER_SIGN(99, 5, "扫码签收照片"),
    /**
     * 附件
     */
    ATTACH(2, 2, "附件"),
    /**
     * 拒签照片
     */
    REJECT(3, 3, "拒签照片"),
    /**
     * 公司开票协议
     */
    OPEN(4, 4, "公司开票协议"),
    /**
     * 回单照片
     */
    RECEIPT(5, 1, "回单照片"),
    ;

    private final Integer value;
    private final Integer newValue;
    private final String name;

    private static final Map<Integer, TransportAttachTypeEnum> MAP = new NamedValueMap<>(TransportAttachTypeEnum.class);

    public static TransportAttachTypeEnum fromValue(Integer value) {
        return MAP.get(value);
    }

}